home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / SpriteWorld 2.2 / SpriteWorld files / Utils / Brian's Extensions / BlitPixieRotated.h < prev    next >
Encoding:
Text File  |  1999-01-14  |  3.2 KB  |  110 lines  |  [TEXT/CWIE]

  1. ///--------------------------------------------------------------------------------------
  2. //    Blit8BitRotatedPixie.h
  3. //
  4. //    Description: This is the include file for all the BlitPixie source files.
  5. ///--------------------------------------------------------------------------------------
  6.  
  7.  
  8. #ifndef __BLITROTATEDPIXIE__
  9. #define __BLITROTATEDPIXIE__
  10.  
  11. #ifndef __BLITPIXIE__
  12. #include "BlitPixie.h"
  13. #endif
  14.  
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20. ///--------------------------------------------------------------------------------------
  21. //    Public API
  22. ///--------------------------------------------------------------------------------------
  23. SW_FUNC OSErr CreateRotatedFrameFromFrame(
  24.     SpriteWorldPtr     destSpriteWorld,
  25.     FramePtr         originalFrameP, 
  26.     FramePtr*         newFramePPtr, 
  27.     int             amountOfRotation);
  28.     
  29. SW_FUNC OSErr SWSetSpriteRotation(
  30.     SpritePtr srcSpriteP,
  31.     unsigned char rotation);
  32. SW_FUNC unsigned char SWGetSpriteRotation(SpritePtr srcSpriteP);
  33.  
  34. ///--------------------------------------------------------------------------------------
  35. //    Function prototypes for Rotation helpers
  36. ///--------------------------------------------------------------------------------------
  37.  
  38. // if using 8, 16, 32, or 64 for this, we have precomputed these arrays in the code
  39. #define kNumberOfRotationSteps 32
  40. // if not uncomment this next line and make sure to call InitializeRotationTables() 
  41. // to initialize these tables
  42. //#define DYNAMICALLY_GENERATE_TABLE
  43.  
  44. extern double sineArray[kNumberOfRotationSteps];
  45. extern double cosineArray[kNumberOfRotationSteps];
  46. extern Boolean gRotationInitialized;
  47.  
  48. void InitializeRotationTables(void);
  49.  
  50. ///--------------------------------------------------------------------------------------
  51. //    Function prototypes for 8-bit  Rotated blitters
  52. ///--------------------------------------------------------------------------------------
  53.  
  54. SW_FUNC void BlitPixieRotateFrame8Bit(
  55.     FramePtr srcFrameP,
  56.     FramePtr dstFrameP,
  57.     Rect *srcRectP,
  58.     Rect *dstRectP,
  59.     short rotation);
  60.  
  61. SW_FUNC void BlitPixie8BitRotatedMaskDrawProc(
  62.     FramePtr srcFrameP,
  63.     FramePtr dstFrameP,
  64.     Rect *srcRect,
  65.     Rect *dstRect);
  66.  
  67. void BlitPixieMask8BitRotated(
  68.     register unsigned char *srcPixelP,
  69.     register unsigned char *dstPixelP,
  70.     register unsigned char *maskPixelP,
  71.     register unsigned long rowsToCopy,
  72.     register unsigned long numBytesPerRow,
  73.     register unsigned long srcOffset,
  74.     register unsigned long dstOffset,
  75.     register unsigned long curRotation);
  76.  
  77. ///--------------------------------------------------------------------------------------
  78. //    Function prototypes for 16-bit  Rotated blitters
  79. ///--------------------------------------------------------------------------------------
  80.  
  81. SW_FUNC void BlitPixieRotateFrame16Bit(
  82.     FramePtr srcFrameP,
  83.     FramePtr dstFrameP,
  84.     Rect *srcRectP,
  85.     Rect *dstRectP,
  86.     short rotation);
  87.  
  88. SW_FUNC void BlitPixie16BitRotatedMaskDrawProc(
  89.     FramePtr srcFrameP,
  90.     FramePtr dstFrameP,
  91.     Rect *srcRect,
  92.     Rect *dstRect);
  93.  
  94. void BlitPixieMask16BitRotated(
  95.     register unsigned short *srcPixelP,
  96.     register unsigned short *dstPixelP,
  97.     register unsigned short *maskPixelP,
  98.     register unsigned long rowsToCopy,
  99.     register unsigned long numBytesPerRow,
  100.     register unsigned long srcOffset,
  101.     register unsigned long dstOffset,
  102.     register unsigned long curRotation);
  103.  
  104.  
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108.  
  109. #endif /* __BLITROTATEDPIXIE__ */
  110.